package com.beesphere.excel.writer;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class LineCellInfo implements Serializable {

	private static final long serialVersionUID = 2151322733925619133L;

	private Map<String, Object> infos;
	
	public LineCellInfo () {
	}
	
	public LineCellInfo (Map<String, Object> infos) {
		this.infos = infos;
	}
	
	public Object getInfo (String name) {
		if (infos == null) {
			return null;
		}
		return infos.get (name);
	}

	public void renew () {
		if (infos != null) {
			infos.clear();
		}
	}

	public void reset () {
		renew ();
		infos = null;
	}

	public void setInfos(Map<String, Object> infos) {
		this.infos = infos;
	}

	public void addInfo(String name, Object value) {
		if (name == null || value == null) {
			return;
		}
		if (infos == null) {
			infos = new HashMap<String, Object> ();
		}
		infos.put (name, value);
	}
	 
}
